package intelligentrecommender.phases.htmlextractor;

import intelligentrecommender.phases.utilities.TagInfo;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 *
 * @author EiasO
 */
public class test {

    public static void main(String[] args) throws IOException {

        List<String> tags = Arrays.asList("H2", "H1", "STRONG");
        HTMLparser hp = new HTMLparser();

        Map<String, TagInfo> emphasizedTagContent = hp.getEmphasizedTagContent("src/intelligentrecommender/phases/htmlextractor/results/", tags);
        Set set = emphasizedTagContent.entrySet();
        Iterator it = set.iterator();

        while (it.hasNext()) {
            // key=value separator this by Map.Entry to get key and value
            Map.Entry m = (Map.Entry) it.next();

            // getKey is used to get key of Map
            String key = (String) m.getKey();

            // getValue is used to get value of key in Map
            List<TagInfo> value = (List<TagInfo>) m.getValue();

            for (TagInfo ti : value) {
                System.out.println(key);
                System.out.println(ti.getTagName() + " ** " + ti.getTagContent());
                System.out.println("-----------------------------------------------------------------------------------");

            }
        }
    }
}
